<template>
	<!--详情界面-->
	<el-dialog title="条款详情" :visible.sync="dialogVisible" size="small" :close-on-press-escape="false" :before-close="off" :top="dialog_margin_top">
		  <el-form label-width="160px">
		  <el-row :span="24">
		  	<el-col :span="12">
		  		<el-form-item label="归属险类" required>
  					<el-input v-model="formData.ownerriskcode" filterable size="small" disabled ></el-input>
				</el-form-item>
				<el-form-item label="主险/附加险" required>
					<el-input v-model="formData.kindType" filterable size="small" disabled ></el-input>
				</el-form-item>
				<el-form-item label="条款代码" required>
					<el-input v-model="formData.kindcode" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="条款中文名称" required>
					<el-input type="textarea" v-model="formData.kindcname" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="条款英文名称" required>
					<el-input type="textarea" v-model="formData.kindename" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="条款版本" required>
					<el-input v-model="formData.kindversion" filterable size="small" disabled ></el-input>
				</el-form-item>
				<el-form-item label="算费方式标识" required>
					<el-select v-model="formData.waysofcalc" filterable size="small"  disabled>
						<el-option v-for="item in calculateTypeOptions" :key="item.value" :label="item.value + '-' + item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item> 
				<el-form-item label="iLog费率配置状态" required>
					<el-select v-model="formData.ilogflag" filterable size="small"  disabled>
						<el-option v-for="item in iLogFlagOptions" :key="item.value" :label="item.value + '-' + item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="短期费率方式" required>
					<el-input v-model="formData.shortratetype" filterable size="small" disabled ></el-input>
		  		</el-form-item>
		  		<el-form-item label="条款性质" required>
						  <el-select v-model="formData.kindNature" disabled placeholder="请选择" size="small">
										<el-option v-for="item in kindNatureOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
									</el-select>
			  		</el-form-item>
				<el-form-item label="备注">
					<el-input type="textarea" v-model="formData.remark" size="small" disabled :rows="2"></el-input>
				</el-form-item>
		  	</el-col>
		  	<el-col :span="12">
				<el-form-item label="固定费率(%)">
					<el-input v-model="formData.agreementrate" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="对应加成条款代码">
					<el-input type="textarea" v-model="formData.pluskindcode" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="加成比例(%)">
					<el-input v-model="formData.plusrate" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="条款权限机构代码">
					<el-input type="textarea" v-model="formData.powagentcode" size="small" disabled></el-input>
				</el-form-item>
				<el-form-item label="是否配置备案号" required>
					<el-select v-model="formData.efilestatus" filterable size="small"  disabled>
						<el-option v-for="item in eFileOptions" :key="item.value" :label="item.value + '-' + item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="是否累计保额" required>
					<el-select v-model="formData.calculateflag" filterable size="small"  disabled>
						<el-option v-for="item in calculateOptions" :key="item.value" :label="item.value + '-' + item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="Cas抄单" required>
					<el-select v-model="formData.cas" disabled filterable size="small" >
						<el-option v-for="item in casOptions" :key="item.value" :label="item.value + '-' + item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="有效标识" required>
					<el-select v-model="formData.validstatus" size="small"  disabled>
						<el-option v-for="item in validOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="版本生效日期" required>
					<el-date-picker type="date" placeholder="选择日期" v-model="formData.startdate" style="width: 100%;" :editable="false" size="small" disabled></el-date-picker>
				</el-form-item>
				<el-form-item label="版本失效日期" required>
					<el-date-picker type="date" placeholder="选择日期" v-model="formData.enddate" style="width: 100%;" :editable="false" size="small" disabled></el-date-picker>
				</el-form-item>
		  	</el-col>
		  </el-row>
		</el-form>
		  <span slot="footer" class="dialog-footer">
			   <el-button @click="off">关闭</el-button>
		  </span>
	</el-dialog>
</template>

<script>
  export default {
	data() {
		return { 
			dialogVisible: true,
			dialog_margin_top: "2%",
			formData: {},
			cas: '',
			kindTypeOptions: [
				{label: '主险',  value: '1'},
				{label: '附加险 ',  value: '2'},
			],
			kindNatureOptions: [
				{label: '0-物质损失',  value: '0'},
				{label: '1-营业中断',  value: '1'},
			],
			iLogFlagOptions: [
				{label: '是',  value: '1'},
				{label: '否 ',  value: '0'},
			],
			calculateOptions: [
				{label: '是',  value: 'Y'},
				{label: '否 ',  value: 'N'},
			],
			casOptions: [
				{label: '抄明细',  value: 'M'},
				{label: '抄备注 ',  value: 'B'},
			],
			eFileOptions: [
				{label: '是',  value: 'Y'},
				{label: '否 ',  value: 'N'},
			],
			calculateTypeOptions: [
				{label: '手录保费',value: '0'},
				{label: '固定费率',value: '1'},
				{label: 'iLog算费',value: '2'},
				{label: '加成比例',value: '3'},
			],
			validOptions: [
				{label : '有效',value: '1'},
				{label : '无效',value: '0'}
			],
		}
	},
	mounted() {
		let temp = Object.assign({}, this.$parent.rowDetail);
		temp.cas = this.$parent.rowDetail.calculateflag.substring(6);
		this.formData = temp;
		this.formData.kindType = this.$parent.rowDetail.kindcode.substring(2,3) == "M" ? "1-主险" : "2-附加险";
		this.formData.calculateflag = this.$parent.rowDetail.calculateflag.substring(0,1);
		this.formData.kindNature = this.$parent.rowDetail.calculateflag.substring(5,6);
	},
	methods: {
		off() {
			this.$parent.showDetailDialog = false;
		}
	}
  }
</script>
